#include <reg52.h>     //51头文件
#include <I2C.h>       //I2C协议
#include <PAJ7620.h>   //PAJ7620模块初始化
#include <Delay.h>     //延时模块
#include <debug.h>     //延时模块


#define  LEDS  P1



void main(void)
{
	
		Delay(100);
    PAJ7620_Init();
    while (1)
    {
		switch (PAJ7620_GetDir())
    {
        case 1:
				{
            LEDS=0xFE;
					  Delay(1000); 
					  printf("UP");
					  Delay(1000);
				}
            break;
        case 2:
            {
            LEDS=0xFd;printf("DOWN");
				}
            break;
        case 3:
             {
            LEDS=0xFb;printf("LIFT");
				}
            break;
        case 4:
             {
            LEDS=0xF7;printf("RIGHT");
				}
            break;
        case 5:
             {
            LEDS=0xef;
				}
            break;
        case 6:
             {
            LEDS=0xdf;
				}
            break;
        case 7:
             {
            LEDS=0xbf;
				}
            break;
        case 8:
             {
            LEDS=0x7f;
				}
            break;
        default:
             {
            LEDS=0xff;//printf("NO MOVE");
				}
						break;
    }
			
    }
}

